import { ApiProperty } from '@nestjs/swagger'
import { IsString } from 'class-validator'

/**
 * 登录请求体，支持用户名或邮箱
 */
export class LoginDto {
  @ApiProperty({ description: '用户名或邮箱', example: 'admin' })
  @IsString()
  usernameOrEmail: string

  @ApiProperty({ description: '密码', example: 'Admin@123' })
  @IsString()
  password: string

  /** 图形验证码内容 */
  @ApiProperty({ description: '图形验证码内容', example: 'abcd' })
  @IsString()
  captcha: string

  /** 图形验证码唯一标识 */
  @ApiProperty({ description: '图形验证码唯一标识', example: 'xxxx-xxxx-xxxx-xxxx' })
  @IsString()
  captchaId: string
}
